
HF_LLAMA_PATH=/teaspeech_ceph/share_976139/users/adrenzhou/nlp_workdir/pretrained_models/Qwen/Qwen2.5-7B-Instruct
#HF_LLAMA_PATH=/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/pretrained_models/Qwen/Qwen2.5-3B-Instruct

# HF_LLAMA_PATH="/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/pretrained_models/Qwen/Qwen2-Audio-7B-Instruct"
#HF_LLAMA_PATH=/teaspeech_ceph/share_976139/users/adrenzhou/exp/exp_meetingGPT/qwen2.5_7b_mglm_datav19.12_TP4_PP2_CP1_MBZ1_GBSZ64_seq8192/hf
TP=4
PP=2

#HF_LLAMA_PATH=/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/pretrained_models/Llama-2-7b-chat-hf

# MEGATRON_FORMAT_DIR=/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/Megatron-LM/qwen2-audio-decoder-megatron-TP${TP}-PP${PP}-TE

#MEGATRON_FORMAT_DIR=/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/Megatron-LM/qwen2.5-1.5b-instruct-megatron-TP${TP}-PP${PP}-TE
#MEGATRON_FORMAT_DIR=/apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/Megatron-LM/qwen2.5-3b-instruct-megatron-TP${TP}-PP${PP}-TE
MEGATRON_FORMAT_DIR=/teaspeech_ceph/share_976139/users/adrenzhou/nlp_workdir/Megatron-LM/qwen2.5-7b-instruct-megatron-TP${TP}-PP${PP}-TE
#MEGATRON_FORMAT_DIR=/teaspeech_ceph/share_976139/users/adrenzhou/exp/exp_meetingGPT/qwen2.5_7b_mglm_datav19.12_TP4_PP2_CP1_MBZ1_GBSZ64_seq8192/mg_format
python tools/checkpoint/convert.py \
    --model-type GPT \
    --loader qwen_te \
    --saver mcore \
    --model-size llama2-7B \
    --megatron-path /apdcephfs_qy3/share_976139/users/adrenzhou/nlp_workdir/Megatron-LM \
    --target-tensor-parallel-size ${TP} \
    --target-pipeline-parallel-size $PP \
    --checkpoint-type hf \
    --load-dir ${HF_LLAMA_PATH} \
    --save-dir ${MEGATRON_FORMAT_DIR} \
    --tokenizer-model ${HF_LLAMA_PATH} \
    --bf16 \
    --saver-transformer-impl transformer_engine \
    --loader-transformer-impl transformer_engine \
